﻿#ifndef KERNEL_FUNCTION_EPANECHNIKOV_H_
#define KERNEL_FUNCTION_EPANECHNIKOV_H_
#include <cmath>

class KernelFunctionEpanechnikov{
	public:
		KernelFunctionEpanechnikov(){}
		~KernelFunctionEpanechnikov(){}
		KernelFunctionEpanechnikov(const KernelFunctionEpanechnikov& other){
			*this = other;
		}

		/*!
		 * @brief カーネル関数の計算
		 * @param x -1<=x<=1の値
		 * */
		inline double operator()(double x)const{
			if(x<-1 || x>1)return 0;
			return (1-std::pow(x,2))*3/4;
		}

		inline const KernelFunctionEpanechnikov& operator=(const KernelFunctionEpanechnikov& other){
			// do nothing
			return *this;
		}
	};
#endif